/*
 * Copyright 2009 Eat Local Food, LLC
 * Copyright (c) 2007 osCommerce (this file was written after
 * code review of osCommerce).
 *
 * This file is part of gwtCommerce.
 *
 * gwtCommerce is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 2 of the License, or
 * (at your option) any later version.
 *
 * gwtCommerce is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with gwtCommerce.  If not, see <http://www.gnu.org/licenses/>.
 */
package com.elf.gwt.common.client.model;

import com.google.gwt.json.client.JSONObject;

/**
 *  
 */
public class CategoryMetaModel extends AbstractModel
{	
	protected int categoriesPerRowMax;
	protected int currentId;
	protected boolean hideEmptyCategories;
	protected double imageHeightMax;
	protected double imageWidthMax;
	protected double smallImageHeightMax;
	protected double smallImageWidthMax;
	protected boolean showCounts;
	protected String storeName;
	
	public CategoryMetaModel(JSONObject jsonObject)
	{
		storeName = convertToString(jsonObject, "store_name");
		showCounts = convertToBoolean(jsonObject, "show_counts");
		imageWidthMax = convertToDouble(jsonObject, "image_width_max");
		imageHeightMax = convertToDouble(jsonObject, "image_height_max");
		smallImageWidthMax = convertToDouble(jsonObject, "small_image_width_max");
		smallImageHeightMax = convertToDouble(jsonObject, "small_image_height_max");
		categoriesPerRowMax = convertToInteger(jsonObject, "categories_per_row_max");
		hideEmptyCategories = convertToBoolean(jsonObject, "hide_empty_categories");
		currentId = convertToInteger(jsonObject, "current_id");
	}
	
	public int getCategoriesPerRowMax() {
		return categoriesPerRowMax;
	}
	public int getCurrentId() {
		return currentId;
	}
	public double getImageHeightMax() {
		return imageHeightMax;
	}
	public double getImageWidthMax() {
		return imageWidthMax;
	}
	public double getSmallImageHeightMax() {
		return smallImageHeightMax;
	}
	public double getSmallImageWidthMax() {
		return smallImageWidthMax;
	}
	public String getStoreName() {
		return storeName;
	}
	public boolean isHideEmptyCategories() {
		return hideEmptyCategories;
	}
	public boolean isShowCounts() {
		return showCounts;
	}
}
